#include <iostream>
#include "HTTP.h"


int main()
{

    HTTP http("www.baidu.com", 80);
    if (http.connect() < 0)
    {
        std::cout << "connect failed" << std::endl;
        return -1;
    }

    char *buffer = http.sendRequest("/");
    if (buffer)
    {
        std::cout << "Response:" << std::endl;
        std::cout << buffer << std::endl;
        free(buffer);
    }
    else
    {
        std::cout << "Failed to get response" << std::endl;
    }

    return 0;
}
